<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>回复</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">


		<link rel="stylesheet" href="forum/css/style.css" type="text/css" />

		<script type="text/javascript" src="forum/js/mycheck.js"></script>

		<script type="text/javascript" src="forum/ckeditor/ckeditor.js"></script>
		<script type="text/javascript">
	CKEDITOR.replace('content');
</script>

		<style>
.quoting {
	background-color: #ddd;
}

.reply {
	background-color: #cccccc;
}
</style>
	</head>
	<body onload="initPage()">
		<input type="hidden" " id="totalPage"
			value="${requestScope.pageBean.totalPages }" />
		<jsp:include page="../include/header.jsp"></jsp:include>

		<input type="hidden" id="publishLimit"
			value="<s:property value="#session.userInfo.limits.publish"/>" />
		<input type="hidden" id="replyLimit"
			value="<s:property value="#session.userInfo.limits.reply"/>" />

		<table class="loginTable" border="0" align="center">
			<!--主题内容区-->
			<jsp:include page="../include/welcomeBanner.jsp"></jsp:include>

			<tr>
				<td class="currentPos" colspan="3">
					<div style="float: left; width: 400px">
						<img src="forum/img/current.png" />
						当前位置：
						<span class="pos"><s:a action="init" namespace="/">首页</s:a>->
							<a href="javascript:void()">${request.topic.title }</a>
						</span>
					</div>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<hr size="4" color="#B5BAC7" style="margin-top: 0px;">
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<s:a action="scan!prepareToPost.action">
						<img src="forum/img/publish_btn.png" border="0" />
					</s:a>
					<a href="javascript:void(0)"
						onclick="document.getElementById('pub').scrollIntoView();"><img
							src="forum/img/reply_btn.png" border="0" /> </a>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<hr>
				</td>
			</tr>
			<tr>
				<td align="right" colspan="2">
					<table border="0">
						<tr>
							<td height="25" colspan="3">
								请选择:第
								<span id="div_a"> <c:forEach var="i" begin="1"
										end="${requestScope.pageBean.totalPages }">
										<c:if test="${requestScope.pageBean.currentPage != i }">
											<a href="JavaScript:toResult(${i});">${i}</a>
										</c:if>
										<c:if test="${requestScope.pageBean.currentPage == i }">
											<strong>${i}</strong>
										</c:if>
									</c:forEach> </span>页 跳转至
								<label>
									<select name="txtPageCode" id="txtPageCode"
										onchange="javascript:gotoPage(this);">
										<c:forEach var="i" begin="1"
											end="${requestScope.pageBean.totalPages }">
											<c:if test="${requestScope.pageBean.currentPage != i }">
												<option value="${i }">
													${i }
												</option>
											</c:if>
											<c:if test="${requestScope.pageBean.currentPage == i }">
												<option value="${i }" selected="selected">
													${i }
												</option>
											</c:if>

										</c:forEach>
									</select>
									页
								</label>
							</td>
							<td>
								当前：第${requestScope.pageBean.currentPage
								}/${requestScope.pageBean.totalPages }页
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<div>
						<input id="tid" type="hidden"
							value="<s:property value="#request.topic.id"/>" />

						<s:iterator var="reply" value="#request.pageBean.data" status="st">
							<table class="tab" align="center" cellspacing="0" cellpadding="0"
								border="1">
								<tr class="firstTr">
									<td width="150px" id="<s:property value="#reply.id+'_name'" />">
										<s:property value="#reply.user.name" />
									</td>
									<td width="760px" id="<s:property value="#reply.id+'_time'" />">
										发表于：
										<s:property value="#reply.pubTime" />
									</td>
									<td>
										<s:property value="#request.pageBean.index+#st.index" />
										楼
									</td>
								</tr>

								<tr class="secondTr">
									<td rowspan="2">
										<img src='<s:property value="#reply.user.picture" />'
											width="150px" height="150px" />

									</td>
									<td colspan="2" height="150px"
										id="<s:property value="#reply.id+'_content'" />">
										${reply.content}
									</td>
								</tr>
								<tr class="thirdTr">
									<td colspan="2">
										<a href="javascript:quoting(<s:property value="#reply.id" />)">
											引用</a>
										<a href="javascript:reply(<s:property value="#reply.id" />)">回复</a>


										<s:if test="#session.userInfo.limits.delete==true">
											<s:iterator var="sec" value="#session.userInfo.sections">
												<s:if test="#sec.sectionName==#reply.topic.section.sectionName">
													<a
														href="javascript:delRpy(<s:property value="#reply.id" />,<s:property value="#request.topic.id"/>)">删除</a>
												</s:if>
											</s:iterator>
										</s:if>
									</td>
								</tr>

							</table>
						</s:iterator>
					</div>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<hr align="center" style="width: 960px">
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<div>
						<div style="float: left; width: 150px;">
							<img src="<s:property value="#session.userInfo.picture" />"
								width="150" height="150">
						</div>


						<a name="pub" id="pub"></a>
						<div style="float: right; width: 800px">
							<s:form action="scan!reply.action">
								<table border="0">
									<tr>
										<td>
											<input type="hidden" " name="tid" value="${request.topic.id}" />

											<textarea id="content" name="content" rows="2" cols="40"
												class="ckeditor">
												</textarea>
										</td>
									</tr>
									<tr>
										<td>
											<input type="button" value="回复" onclick="checkRpyInfo()">

										</td>
									</tr>
								</table>
							</s:form>
						</div>
					</div>
				</td>

			</tr>


		</table>

		<jsp:include page="../include/footer.jsp"></jsp:include>
	</body>
</html>
